// /**
//  * Created by asus on 2018/6/9.
//  */
(function() {
    $.extend({
        removeModa:function(){
        	$('body',parent.document).find(".popup-bg").fadeOut(300);
//            $('.popup-bg').fadeOut(300);
            setTimeout(function(){
            	$('body',parent.document).find(".popup-bg").remove();
//                $('.popup-bg').remove();
            },300)
        },
        myConfirm: function(options) {
            //参数格式{title:'Title',message:'message',callback:function(){alert('callback')}}or"需要提示的话"$.myConfrim()
            var option={message:"是否确认删除",callback:function(){}};
            console.info(typeof(options))
            if(typeof(options)=="string"){

                option.message=options;
            }else{
                option=$.extend(option,options);
            }

            $('body',parent.document).append('<div class="popup-bg"><div class="popup-box"><img class="del-img" src="image/delete.png" alt=""><div class="message">'+option.message+'</div><div class="alertbox"><a class="cancel-button exit">取消</a><a class="cancel-button keep-button sure">保存</a></div></div></div>');
            $('body',parent.document).on('click', '.exit',function(){
                $.removeModa();
            });
            $('body',parent.document).on('click', '.sure',function(){
                $.removeModa();
                option.callback();
            });
        }
    });
})(jQuery);

